<?php

namespace App\Admin\Controllers;

use App\Http\Controllers\Controller;
use Encore\Admin\Controllers\Dashboard;
use Encore\Admin\Layout\Column;
use Encore\Admin\Layout\Content;
use Encore\Admin\Layout\Row;
use Encore\Admin\Widgets\Box;
use Encore\Admin\Widgets\InfoBox;

class HomeController extends Controller
{
    public function index(Content $content)
    {
        return $content
            ->title('首页')
            ->row(function ($row) {
                $row->column(3, new InfoBox('商品总量', 'shopping-cart', 'aqua', '/demo/users', '1024'));
                $row->column(3, new InfoBox('用户总量', 'users', 'green', '/demo/orders', '150%'));
                $row->column(3, new InfoBox('订单总量', 'shopping-cart', 'yellow', '/demo/articles', '2786'));
                $row->column(3, new InfoBox('评价总量', 'file', 'red', '/demo/files', '698726'));
            })
//            ->row(function (Row $row) {
//                $row->column(12, new InfoBox('商品总量', '', '', '', '1024'));
//            })
            ->row(new Box('近七日交易走势', view('admin.chartjs')));
    }
}
